<div class="wrap">
  <div class="wrap-content">
    <p-panel [showScroll]="false" headerClass="bg-none">
      <p-header>
        <div class="text-right p-6-0">
          <span class="border-l-1a8fe8 p-l-8 pull-left m-t-8 m-b-10">
            查看延期
            <span class="panel-status-success" *ngIf="item && item.status">{{storage.dicFilter('delaystatus', item.status)}}</span>
          </span>
          <button pButton *ngIf="approveBtnIsShow" type="button" (click)="openWindow();" label="延期审核" class="btn-secondary"></button>
          <button pButton *ngIf="assistBtnIsShow" type="button" (click)="openAssistWindow();" label="协助处理" class="btn-secondary"></button>
        </div>
      </p-header>
      <p-doubleTable [titleWidth]="120" [value]="item" [rowClos]="itemCol">
      </p-doubleTable>

    </p-panel>

    <!-- 操作记录 begin-->
    <p-panel headerClass="bg-none " contentClass="p-0" styleClass="m-t-20 radius-none">
      <p-header>
        <div class="text-right p-6-0">
          <span class="border-l-1a8fe8 p-l-8 pull-left m-t-8 m-b-10">
            操作人记录
          </span>
          <span style='height:33px;display:inline-block;width: 1px;'></span>
        </div>
      </p-header>
      <div class="p-20 border-b-d9d9d9">
        <p-dataTable [value]="operations" [showTableHeader]="true">
          <p-column *ngFor="let col of operationsCol" [field]='col.field' [header]='col.header' [hidden]="col.hidden" [style]="{'width':col.width}">
            <ng-template let-index="rowIndex" let-data="rowData" pTemplate="body" *ngIf="col.dic">
              <span *ngIf="col.field == 'afterSubmitStatus'"> {{storage.dicFilter(col.dic,data[col.field])}} </span>
              <span *ngIf="col.field == 'creater'">
                {{data[col.field]}} &nbsp; {{storage.dicFilter(col.dic,data['userType'])}}
              </span>
            </ng-template>
            <ng-template let-index="rowIndex" let-data="rowData" pTemplate="body" *ngIf="col.tem">
              <span *ngIf="col.field == 'sortNum'"> {{index + 1}} </span>
            </ng-template>
          </p-column>
        </p-dataTable>
      </div>
    </p-panel>
    <!-- 操作记录 end-->
  </div>
</div>

<!-- 表单 begin-->
<p-dialog [header]="'审核'" [(visible)]="isShow" modal="modal" width="700" [responsive]="true">
  <div class="text-center">
    <div class="inline-block">
      <form #form="ngForm" (ngSubmit)="form.form.valid" novalidate class="form-horizontal" role="form">

        <div class="table-row">
          <div class="table-cell text-right p-l-25 p-required">审核结果：</div>
          <div class="table-cell text-left relative">
            <p-radioButton name="status" value="approveresult_approve" label="通过" [(ngModel)]="formObj.approveReasult"></p-radioButton>
            <p-radioButton name="status" value="approveresult_noapprove" label="不通过" [(ngModel)]="formObj.approveReasult"></p-radioButton>
            <p-message *ngIf="approveReasultError" [severity]="'error'" styleClass="p-center" [text]="approveReasultError" style="">
            </p-message>
          </div>
        </div>

        <div class="table-row">
          <div class="table-cell text-right p-l-25 v-top p-required">原因/备注：</div>
          <div class="table-cell relative">
            <textarea rows="5" cols="35" name='approveReason' [(ngModel)]="formObj.approveReason" [ngStyle]="{'width': '220px' }" maxlength="50"
              pInputTextarea (blur)="checkApproveReason()" (focus)="approveError = ''" [ngClass]="approveError ? 'p-input-error' : ''">
                            </textarea>
            <div class="text-right opacity06">还可输入{{50 - (formObj.approveReason?.length || 0)}}个字</div>
            <p-message *ngIf="approveError" styleClass="p-right m-t-10" [severity]="'error'" [text]="approveError">
            </p-message>
          </div>
        </div>

        <div class="table-row">
          <div class="table-cell text-right p-l-25"></div>
          <div class="table-cell text-left">
            <button pButton (click)="saveApprove();" label="确定" class="btn-success"></button>
            <button pButton (click)="isShow = false;" label="取消" class="btn-secondary m-r-30 m-l-8"></button>
          </div>
        </div>

      </form>

    </div>
  </div>
</p-dialog>
<!-- 表单 end-->

<!-- 表单 begin-->
<p-dialog [header]="'协助处理'" [(visible)]="assistIsShow" modal="modal" width="700" [responsive]="true">
  <div class="text-center">
    <div class="inline-block">
      <form #form="ngForm" (ngSubmit)="form.form.valid" novalidate class="form-horizontal" role="form">

        <div class="table-row">
          <div class="table-cell text-right p-l-25 p-required">协助结果：</div>
          <div class="table-cell text-left relative">
            <p-radioButton name="status" value="assistresult_180208000011" label="客户重新确认" [(ngModel)]="assist.assistReason"></p-radioButton>
            <p-radioButton name="status" value="assistresult_180208000012" label="关闭" [(ngModel)]="assist.assistReason"></p-radioButton>
            <p-message *ngIf="assistReasonError" [severity]="'error'" styleClass="p-center" [text]="assistReasonError">
            </p-message>
          </div>
        </div>

        <div class="table-row">
          <div class="table-cell text-right p-l-25 v-top p-required">原因/备注：</div>
          <div class="table-cell relative">
            <textarea rows="5" cols="35" name='assistReason' [(ngModel)]="assist.reason" [ngStyle]="{'width': '220px' }" maxlength="50"
              pInputTextarea (blur)="checkAssistReason()" (focus)="assistError = ''" [ngClass]="assistError ? 'p-input-error' : ''">
                            </textarea>
            <div class="text-right opacity06">还可输入{{50 - (assist.reason?.length || 0)}}个字</div>
            <p-message *ngIf="assistError" styleClass="p-right m-t-10" [severity]="'error'" [text]="assistError">
            </p-message>
          </div>
        </div>

        <div class="table-row">
          <div class="table-cell text-right p-l-25"></div>
          <div class="table-cell text-left">
            <button pButton (click)="saveAssist();" label="确定" class="btn-success"></button>
            <button pButton (click)="assistIsShow = false;" label="取消" class="btn-secondary m-l-8"></button>
          </div>
        </div>

      </form>

    </div>
  </div>
</p-dialog>
<!-- 表单 end-->
